{% extends "main.html" %}

{% block content %}
<div class="content-box">
  <div class="content-box-header">
    <h3>Condominium</h3>
    <ul class="content-box-tabs">
      <li><a href="#tab1" class="default-tab">Lista</a></li>
      {% if user.is_staff %}
        <li><a href="/condominos/novo">Add Condominium</a></li>
      {% endif %}
    </ul>
    <div class="clear"></div>
</div>

<div class="content-box-content">
  <div class="tab-content default-tab" id="tab1">
      
      <table>
        <thead>
          <tr>
            <th>User</th>
            <th>Owner</th>
            <th>TIN</th>
            <th>Address</th>
            <th>Telephone</th>
            <th>Email</th>
	    {%if user.is_staff %}<th>Last login</th>
            <th></th>{% endif %}
          </tr>
        </thead>
	{% for condomino in object_list %}
	<tr> 
	  <td>{{condomino.user}}</td>
	  <td>{{condomino.proprietario}}</td>
	  <td>{{condomino.nif}}</td>
	  <td>{{condomino.morada}}</td>
	  <td>{{condomino.telefone}}</td>
          <td>{{condomino.email}}</td>
	  {%if user.is_staff %}<td>{{ condomino.user.last_login|date:"D, d F Y - H:i" }}</td>
	    <td><a href="{% url editar_condomino condomino.id %}">Edit</a></td>{% endif %}
        </tr> 
	{% endfor %}
      </table>
      <p></p>
      <!--
      <div class="notification information png_bg">
        <div>Nº total de Condóminos: {{totalCondominos}}</div>
      </div>
      -->
    </div>
  </div>
</div>
{% endblock %}
